import framework.bean.NeedScanPackageBean;
import framework.director.BaseDirector;
import framework.director.FirstDirector;
import framework.needscan.inject.InjectScanner;
import test.test.my.singletest.MobilePhone;
import test.test.my.singletest.Phone;

/**
 * @author 马洁
 * @date 2020/3/10 - 17:12
 */
public class Test {
    /**
     * 需要扫描的model, 相对于当前框架的Root来相对。
     */
    private static final String MODEL_NAME = "single_version/src/main/java";

    public static void main(String[] args) {
        // 需要扫描的包
        String packageName = "test";
        // 扫描bean
        NeedScanPackageBean packageBean = new NeedScanPackageBean(MODEL_NAME, packageName);
        // 依赖注入实现类设置
        InjectScanner.add(Phone.class, MobilePhone.class);
        // 指挥者
        BaseDirector director = new FirstDirector(packageBean);
        director.init();

        for (String s : getTestArr()) {
            director.start(s);
        }
    }

    private static String[] getTestArr() {
        return new String[]{"/hello", "/strTest", "/phoneTest"};
    }
}
